package com.linewell.license.demo.designPattern.createPattern.FactotyPattern;

import com.linewell.license.demo.designPattern.createPattern.FactotyPattern.car.Car;
import com.linewell.license.demo.designPattern.createPattern.FactotyPattern.car.CarFactory;

/**
 * @Title: springBootDemo
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2019/11/22
 */
public class AbstractFactoryPattern {

    public static void main(String[] args) {
        CarFactory carFactory = new CarFactory();
        //获取宝马
        Car BMW = carFactory.getCar("BMW");
        BMW.run();
        //获取梅赛德斯
        Car Mercedes = carFactory.getCar("Mercedes");
        Mercedes.run();
        //获取汽车
        Car car = carFactory.getCar("car");
        car.run();
    }
}

